package com.sherwin.sourdoughapp

import android.app.Application
import android.content.Context
import com.orhanobut.logger.AndroidLogAdapter
import com.orhanobut.logger.Logger
import com.sherwin.sourdoughapp.candy.lazySingleton
import java.lang.Exception
import kotlin.properties.Delegates

class App  : Application(){

    fun handleError(exception: Exception){

    }

    override fun onCreate() {
        super.onCreate()
        initLogger()
    }

    private fun initLogger(){
        Logger.addLogAdapter(object : AndroidLogAdapter(){
            override fun isLoggable(priority: Int, tag: String?): Boolean {
                return BuildConfig.DEBUG
            }
        })
    }

    companion object{
        @JvmStatic var instance : App by Delegates.lazySingleton()
    }


}